package com.cc.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author CC
 * @version 1.0
 * @description: TODO
 * @date 2025/9/22 8:27
 */
@Data
public class BaseEntity {
    @Schema(description = "创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
    @TableField("deleted_at")
    @Schema(description = "删除时间")
    private LocalDateTime deletedAt;
    @TableField("created_by")
    @Schema(description = "创建人")
    private String createdBy;
    @TableField("updated_by")
    @Schema(description = "更新人")
    private String updatedBy;
    @TableField(value = "version", fill = FieldFill.INSERT)
    @Version
    @Schema(description = "版本")
    private Integer version;
}
